// used for checkbox validation
function validate()
{
	var oCheck = document.getElementsByName('hobbies[]');
	var count = 0;
	var minCount = 2;
	//alert(oCheck.length);// number of checkbox
	var numOfcheckbox = oCheck.length;
	for(var i = 0 ; i < numOfcheckbox ; i++) {
		//alert(oCheck[i].checked)
		if(oCheck[i].checked == true){
			count++;
		}
	}
	if(count < minCount){
		alert("Please select at least "+minCount+" hobbies");
		return false;
	}
	//alert(count);
	return true;
}

// used for form vaalidation 
function validate1(obj)
{
	var oUname = obj.uname;
	var oEmail = obj.email;

	if(oUname.value == ""){
		alert("Name should not be empty");
		oUname.focus()
		return false;
	} else 
	if(oUname.value.length < 8){
		alert("Name should be 8 char long");
		oUname.focus()
		oUname.select()
		return false;
	} else 
	if(oEmail.value == ""){
		alert("Email should not be empty");
		oEmail.focus();		
		return false;
	}

	
} // end of validate()

